package com.fight.strive.sys.modules.scheduler;

import com.fight.strive.sys.modules.redis.RedisKeyExpirationHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Slf4j
@Component("key_expiration_event:scheduler_running")
public class SchedulerStoppedHandler implements RedisKeyExpirationHandler {

    @Resource
    private Scheduling scheduling;

    @Override
    public void handle(String keyName) {
        // 重新运行调度器
        scheduling.afterPropertiesSet();
    }
}
